package mware_lib.namensdienst.communication;

import java.io.*;
import java.net.Socket;
import java.net.UnknownHostException;

public class Client {
	private Socket mySocket;
	ObjectConnection oc;


	public Client(String host, int port) throws UnknownHostException, IOException {
		mySocket = new Socket(host, port);
		oc = new ObjectConnection(mySocket);
	}

	public Object receive() throws IOException, ClassNotFoundException {
		return oc.receive();
	}

	public void send(Object msg) throws IOException {
		oc.send(msg);
	}

	public void close() throws IOException {
		oc.close();
	}

}
